package lanqiao;

import java.util.Scanner;

public class Test {
	public static void main4(String[] args) {
		Scanner sc = new Scanner(System.in);
        int x = sc.nextInt();
        //拿到十万位的数字
        int xx = x / 10_0000;
        //拿到万位之后的数字（包含万位）
        int xxx = x - xx * 10_0000;
        //xxx再乘以10 + xx
        int xxxx = xxx * 10 + xx;
        System.out.println(xxxx);
	}
	public static void main3(String[] args) {
		long x = 2;
		int y = 2023;
		while(y > 0) {
			x = x * x;
			y--;
		}
		System.out.println(x);
	}
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long x = sc.nextLong();
		//这个就是结果，输出这个数
		while(x >= 10) {
			long xx = 1;
			while(x != 0) {
				//x的最后一位
				int y = 0;
				//拿x最后一位
				y = (int)x % 10;
				if(y != 0) {
					xx *= y;
				}
				x /= 10;
			}
			System.out.println(xx);
			x = xx;
		}
	}
	public static void main1(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.nextLine();
		int len = s.length();
		
		for(int i = len - 1; i >= 0; i--) {
			char ch = s.charAt(i);
			if(ch == 'a') {
				System.out.print(ch);
				break;
			}
			if(ch == 'e') {
				System.out.print(ch);
				break;
			}
			if(ch == 'i') {
				System.out.print(ch);
				break;
			}
			if(ch == 'o') {
				System.out.print(ch);
				break;
			}
			if(ch == 'u') {
				System.out.print(ch);
				break;
			}
		}
	}
}